<template>
    <tr >
      <th >
        <input type="checkbox" v-model="stAll"/> <span>全选</span>
      </th>
      <th>名称</th>
      <th>价格</th>
      <th>数量</th>
      <th>总价</th>
      <th>操作</th>
    </tr>
</template>

<script>
export default {
  data () {
    return {
    }
  },
  props: ['lists'],
  created () {
    console.log(this.lists)
  },
  computed: {
    stAll: {
      get () {
        return this.lists.every(item => item.checked === true)
      },
      set (val) {
        console.log(val)
        this.lists.forEach(item => {
          item.checked = val
        })
      }
    }
  },
  methods: {

  }
}
</script>

<style scoped lang='less'>

</style>
